package cn.domypay.back.biz.impl;

import java.util.Properties;

import cn.domypay.back.base.impl.BaseBizImpl;
import cn.domypay.back.bean.DmpOrderInfo;
import cn.domypay.back.bean.DmpPerpaidLog;
import cn.domypay.back.biz.DmpPerpaidLogBiz;
import cn.domypay.back.exception.DoMyPayException;
import cn.domypay.back.utils.DateUtil;

public class DmpPerpaidLogBizImpl extends BaseBizImpl implements DmpPerpaidLogBiz {
	
	public void addDmpPerpaidLog(DmpOrderInfo dmpOrderInfo,String[] results,Properties prop) throws DoMyPayException
	{
		DmpPerpaidLog dmpPerpaidLog = new DmpPerpaidLog();
		dmpPerpaidLog.setOrderId(dmpOrderInfo.getOrderId());
		dmpPerpaidLog.setPerpaidId(results[0]); //充值通过webservice提交之后返回的查询流水号
		dmpPerpaidLog.setStoreId(dmpOrderInfo.getStoreId());
		dmpPerpaidLog.setPerpaidPhone(dmpOrderInfo.getMobilePhone());
		dmpPerpaidLog.setTerminalNo(prop.getProperty("perpaid.terminalNo")); //从domypayEngine.properties中获取终端号码
		dmpPerpaidLog.setAddTime(DateUtil.getIntDate());
		dmpPerpaidLog.setMarketPrice(dmpOrderInfo.getMarketPrice());
		dmpPerpaidLog.setGoodsPrice(dmpOrderInfo.getOrderAmount());
		//保存充值返回信息
		this.getBaseDao().add(dmpPerpaidLog, "addPerpaidLog");
	}
}
